package com.tucy.logistics.modules.system.captcha.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tucy.logistics.common.entity.user.SystemCaptcha;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author tucy123
* @description 针对表【system_captcha(系统文件表)】的数据库操作Mapper
* @createDate 2023-09-06 09:34:14
* @Entity com.tucy.logistics.modules.captcha.SystemCaptcha
*/
@Mapper
public interface SystemCaptchaMapper extends BaseMapper<SystemCaptcha> {

    /**
     * 保存验证码
     * @param systemCaptcha
     */
    @Insert("insert into system_captcha value (#{systemCaptcha.uuid},#{systemCaptcha.captcha},#{systemCaptcha.expireTime},#{systemCaptcha.createTime},#{systemCaptcha.updateTime},#{systemCaptcha.commonStatus})")
    void mathSaveCaptcha(@Param("systemCaptcha") SystemCaptcha systemCaptcha);

    /**
     * 删除过期验证码
     * @param strings
     */
    void deleteCaptcha(@Param("strings") List<String> strings);

    /**
     * 查询验证码
     * @param uuid
     * @return
     */
    @Select("select * from system_captcha where uuid = #{uuid}")
    SystemCaptcha queryCaptcha(@Param("uuid") String uuid);
}




